package com.hqyj.controller;


import com.hqyj.excepiton.QuestionException;
import com.hqyj.pojo.Question;
import com.hqyj.pojo.UserInfo;
import com.hqyj.service.IUserInfoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.HashMap;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author rock
 * @since 2023-10-07
 */
@RestController
@RequestMapping("/user-info")
public class UserInfoController {

    @Autowired
    IUserInfoService userInfoService;

    //登录
    @PostMapping ("/user")
    public HashMap<String,Object> login(@RequestBody UserInfo u)  {
        return userInfoService.login(u);
    }

    //
    @GetMapping ("/user")
    public HashMap<String,Object> query(String userName)  {

        return userInfoService.queryPowerByUserName(userName);
    }
}

